<phone:PhoneApplicationPage
    x:Class="LyonMag.comments"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="0,0,0,0" Background="#AD1F15" Orientation="Horizontal">
            <Image x:Name="imgLogo" Source="Assets/Licons/navBar.png" Margin="-130,0,0,0"></Image>
            <Button Content="Deconnexion" x:Name="btnLogout" Background="Gray" Width="180" FontSize="20" Visibility="Collapsed" Margin="-280,0,0,0" Foreground="White" Click="btnLogout_Click"></Button>   
        </StackPanel>


            <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <StackPanel>
                <TextBlock Text="Déposer un commentaire" Foreground="Black" Margin="15,0,0,0"></TextBlock>
                <StackPanel Orientation="Horizontal">
                    <TextBox Width="350" Height="150" BorderBrush="Orange" x:Name="txtComment"></TextBox>
                    <Button Content="Envoyer" Width="120" Foreground="Black" Background="Gray" Height="100" Margin="0,-50,0,0" x:Name="btnSubmit" Click="btnSubmit_Click" Padding="-1,0,0,0"></Button>
                </StackPanel>
            </StackPanel>
            <ListBox x:Name="lstForum" Margin="0,200,0,0">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel>
                            <TextBlock Text="{Binding Comment_name}" Foreground="Black" FontSize="25" FontWeight="Bold" TextWrapping="Wrap"> </TextBlock>
                            <TextBlock Text="{Binding Comment_text}" Foreground="Black" TextWrapping="Wrap"></TextBlock>
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </Grid>
        <Popup x:Name="popSecond" Grid.Row="2" Margin="38,250,0,0">
            <Border  CornerRadius="10" BorderBrush="Gray" BorderThickness="5">
                <StackPanel Background="Gray" Width="400">
                    <TextBlock Margin="10,0,10,0"  Text="Le commentaire a bien été  ajouté. " Width="400" TextWrapping="Wrap"></TextBlock>
                    <TextBlock Height="3"></TextBlock>
                    <TextBlock Margin="10,0,10,0"  Text="   Il apparaitra  en ligne dés sa validation par un administrateur." Width="400" TextWrapping="Wrap"></TextBlock>
                    <Button Content="Fermer" x:Name="btnCloseSecond" Click="btnCloseSecond_Click"></Button>
                </StackPanel>
            </Border>
        </Popup>
        <Popup x:Name="popLoginFailed">
            <StackPanel Background="Black" Opacity="0.8" HorizontalAlignment="Center" Width="400" Margin="50,300,0,0">
                <TextBlock Text="Pseudo ou mot de passe non valide!" HorizontalAlignment="Center"></TextBlock>
                <Button Width="200" HorizontalAlignment="Center" Content="Fermer" x:Name="btnFermerloginfailed" Click="btnFermerloginfailed_Click"></Button>
            </StackPanel>
        </Popup>
        <Popup x:Name="popNickName" Grid.Row="1" VerticalAlignment="Center" Width="800" Margin="40,-300,0,0" >
            <Border  CornerRadius="10" BorderBrush="Gray" BorderThickness="5">
                <StackPanel
                Orientation="Vertical" Background="Gray" Width="400">
                    <StackPanel>
                        <TextBlock Text="Saississez votre pseudo" HorizontalAlignment="Center"></TextBlock>
                    </StackPanel>
                    <StackPanel>
                        <TextBox x:Name="txtNickName"></TextBox>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                        <Button x:Name="btnEnter" Content="Envoyer" Click="btnEnter_Click"></Button>
                        <Button x:Name="btnCancel" Content="Annuler" Click="btnCancel_Click"></Button>
                    </StackPanel>
                </StackPanel>
            </Border>
        </Popup>
        <Popup x:Name="popSubmit" Grid.Row="1" Margin="40,200,0,0" >
            <Border CornerRadius="2" BorderBrush="Gray" BorderThickness="5">
            <StackPanel Background="Gray" Width="400">
                <StackPanel>
                        <TextBlock Margin="10,0,8,0" Width="400"  Text=" Le commentaire a bien été  ajouté  ! 
                                   Il apparaitra en ligne dés sa validation par un administrateur ." TextWrapping="Wrap"></TextBlock>
                        <TextBlock Text="-" HorizontalAlignment="Center"></TextBlock>   
                        <TextBlock Margin="10,0,10,0" Text=" Ce pseudo est disponible, voulez-vous le réserver ?" TextWrapping="Wrap"></TextBlock>
                </StackPanel>
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                        <Button Content="Reserver " x:Name="btnLogin" Click="btnLogin_Click"></Button>
                        <Button Content="Non Merci" x:Name="btnTryAgain" Click="btnTryAgain_Click"></Button>
                </StackPanel>
            </StackPanel>
            </Border>
        </Popup>

        <Popup x:Name="popEMail" Margin="150,150,40,0" Grid.Row="2">
            <Border BorderBrush="Gray" BorderThickness="8" CornerRadius="10">
            <StackPanel Background="Gray" HorizontalAlignment="Center">
                <TextBlock Text="Cet email est incorrect"></TextBlock>
                <Button Content="Fermer" x:Name="popValidEmail" Click="popValidEmail_Click"></Button>
            </StackPanel>
            </Border>
        </Popup>
            <StackPanel Height="400" Background="Gray" Visibility="Collapsed" x:Name="popRigister" Margin="40,-100,40,0" Grid.Row="1">
           
                <StackPanel>
                    <TextBlock Text="Inscription" HorizontalAlignment="Center"></TextBlock>
                </StackPanel>
                <StackPanel>
                    <TextBlock Text="Pseudo" Margin="10,0,0,0"></TextBlock>
                    <TextBox  x:Name="txtUserName"></TextBox>
                </StackPanel>
                <StackPanel>
                    <TextBlock Text="Email" Margin="10,0,0,0"></TextBlock>
                    <TextBox x:Name="txtEmail"></TextBox>
                </StackPanel>
                <StackPanel>
                    <TextBlock Text="Mot de passe" Margin="10,0,0,0"></TextBlock>
                    <PasswordBox x:Name="txtPasswor"></PasswordBox>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <Button Content="Reserver" x:Name="btnRegister" Width="200" Click="btnRegister_Click"></Button>
                    <Button Content="Annuler" x:Name="btnCamcelRegister" Width="200" Click="btnCamcelRegister_Click"></Button>
                </StackPanel>
         
        </StackPanel>
            
     
        <Popup x:Name="popAlert" Margin="30,180,0,0" Grid.Row="2">
            <Border CornerRadius="10" BorderBrush="Gray" BorderThickness="5">
            <StackPanel Background="Gray">
                    <TextBlock Width="400" Margin="10,0,10,0" TextWrapping="Wrap"  Text="Votre compte a bien été créé. 
                               Un email de confirmation vient de vous être envoyé." HorizontalAlignment="Center"></TextBlock>
                    <TextBlock Height="10"></TextBlock>
                    <TextBlock Width="400" Margin="10,0,10,0" TextWrapping="Wrap" Text="    Pour poster des commentaires avec un compte différent, cliquez sur le bouton de déconnexion qui vient d'apparaître en haut de l'écran"></TextBlock>
                <Button Content="Fermer" x:Name="popafterregistration" Click="popafterregistration_Click"></Button>
            </StackPanel>
            </Border>
        </Popup>
        <Popup x:Name="poplogout" Margin="20,220,0,0" Grid.Row="2">
            <Border  CornerRadius="10" BorderBrush="Gray" BorderThickness="5">
                <StackPanel Background="Gray">
                   
                    <TextBlock Width="400" Margin="10,0,10,0" Text="Vous êtes maintenant déconnecté. " HorizontalAlignment="Center" TextWrapping="Wrap"></TextBlock>
                    <TextBlock Height="3"></TextBlock>
                    <TextBlock Margin="10,0,10,0" Text="    Pour poster des commentaires avec votre compte,saisissez votre pseudo lors de l'envoi" Width="400" TextWrapping="Wrap"></TextBlock>
                    <Button Content="Fermer" x:Name="BtnLogoutNew" Click="BtnLogoutNew_Click"></Button>
                </StackPanel>
            </Border>
        </Popup>
        <Popup x:Name="popLogins" VerticalAlignment="Center" Grid.Row="1" Margin="60,-300,0,0">
            <Border  CornerRadius="10" BorderBrush="Gray" BorderThickness="5">
                <StackPanel Background="Gray">
                    <StackPanel>
                        <TextBlock Text="Ce nom d'utilisateur est réservé ou incorrect. 
                                   Connectez-vous s'il s'agit du votre." Width="300" TextWrapping="Wrap"></TextBlock>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <Button x:Name="btnLoginnew" Click="btnLoginnew_Click" Content="Se connecter"></Button>
                        <Button x:Name="btnTrynew" Click="btnTrynew_Click" Content="Réessayer"></Button>
                    </StackPanel>
                </StackPanel>
            </Border>
        </Popup>
        <Popup x:Name="popLogin" Margin="40,180,0,0" Grid.Row="1">
            <Border  CornerRadius="10" BorderBrush="Gray" BorderThickness="5">
                <Grid VerticalAlignment="Center" HorizontalAlignment="Center" Width="400" Background="Gray">
                    <StackPanel>
                        <StackPanel>
                            <TextBlock Text="Connexion" HorizontalAlignment="Center"></TextBlock>
                        </StackPanel>
                        <StackPanel>
                            <TextBlock Margin="10,0,10,0" Text="Pseudo"></TextBlock>
                            <TextBox x:Name="txtUsernamePassword"></TextBox>
                        </StackPanel>
                        <StackPanel>
                            <TextBlock Margin="10,0,10,0" Text="Mot de passe"></TextBlock>
                            <PasswordBox x:Name="txtPasswordPassword"></PasswordBox>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <Button Content="OK" x:Name="btnLoginUser" Width="200" Click="btnLoginUser_Click"></Button>
                            <Button Content="Annuler" x:Name="btnLoginCancel" Width="200" Click="btnLoginCancel_Click"></Button>
                        </StackPanel>

                    </StackPanel>
                </Grid>
            </Border>
        </Popup>
    </Grid>
    <!--<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Se déconnecter" Click="ApplicationBarIconButton_Click"/>

        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>-->


</phone:PhoneApplicationPage>